<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="robots" content="noodp" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
        <title>Hugo LoveIt - 我的Hugo博客</title><meta name="Description" content=""><meta property="og:title" content="Hugo LoveIt" />
<meta property="og:description" content="下载hugo https://github.com/gohugoio/hugo/releases
下载对应的版本，我这里下载的是Windows-64bit.zip
配置环境变量 系统变量的Path
复制hugo.exe的路径到上图所示
创建站点 打开cmd进入到hugo.exe目录下执行hugo version可以查看版本
hugo new site sitename(sitename是自定义文件夹名称)
hugo new site sitename 下载并设置主题 在cmd下进入sitename目录下
git clone https://gitee.com/xls7771/LoveIt.git themes/LoveIt(主题可以自行查找，这里我选的是LoveIt，加粗字体是必须写的，其他的可以自定义)
git clone https://gitee.com/xls7771/LoveIt.git themes/LoveIt 在本地启动个人博客 配置config.toml 其中的title可以设置页面的标题
baseURL = &#34;http://example.org/&#34; # [en, zh-cn, fr, ...] determines default content language defaultContentLanguage = &#34;en&#34; # language code languageCode = &#34;en&#34; title = &#34;My New Hugo Site&#34; # Change the default theme to be use when building the site with Hugo theme = &#34;LoveIt&#34; [params] # LoveIt theme version version = &#34;0." />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://xls7771.gitee.io/posts/hugo-loveit/" />
<meta property="article:published_time" content="2020-10-27T23:36:15+08:00" />
<meta property="article:modified_time" content="2020-10-27T23:36:15+08:00" />
<meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="Hugo LoveIt"/>
<meta name="twitter:description" content="下载hugo https://github.com/gohugoio/hugo/releases
下载对应的版本，我这里下载的是Windows-64bit.zip
配置环境变量 系统变量的Path
复制hugo.exe的路径到上图所示
创建站点 打开cmd进入到hugo.exe目录下执行hugo version可以查看版本
hugo new site sitename(sitename是自定义文件夹名称)
hugo new site sitename 下载并设置主题 在cmd下进入sitename目录下
git clone https://gitee.com/xls7771/LoveIt.git themes/LoveIt(主题可以自行查找，这里我选的是LoveIt，加粗字体是必须写的，其他的可以自定义)
git clone https://gitee.com/xls7771/LoveIt.git themes/LoveIt 在本地启动个人博客 配置config.toml 其中的title可以设置页面的标题
baseURL = &#34;http://example.org/&#34; # [en, zh-cn, fr, ...] determines default content language defaultContentLanguage = &#34;en&#34; # language code languageCode = &#34;en&#34; title = &#34;My New Hugo Site&#34; # Change the default theme to be use when building the site with Hugo theme = &#34;LoveIt&#34; [params] # LoveIt theme version version = &#34;0."/>
<meta name="application-name" content="我的Hugo博客">
<meta name="apple-mobile-web-app-title" content="我的Hugo博客"><link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />
        <link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
        <link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"><link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"><link rel="manifest" href="/site.webmanifest"><link rel="canonical" href="https://xls7771.gitee.io/posts/hugo-loveit/" /><link rel="prev" href="https://xls7771.gitee.io/posts/linux/" /><link rel="next" href="https://xls7771.gitee.io/posts/redis/" /><link rel="stylesheet" href="/lib/normalize/normalize.min.css"><link rel="stylesheet" href="/css/style.min.css"><link rel="stylesheet" href="/lib/fontawesome-free/all.min.css"><link rel="stylesheet" href="/lib/animate/animate.min.css"><script type="application/ld+json">
    {
        "@context": "http://schema.org",
        "@type": "BlogPosting",
        "headline": "Hugo LoveIt",
        "inLanguage": "zh-cn",
        "mainEntityOfPage": {
            "@type": "WebPage",
            "@id": "https:\/\/xls7771.gitee.io\/posts\/hugo-loveit\/"
        },"genre": "posts","wordcount":  258 ,
        "url": "https:\/\/xls7771.gitee.io\/posts\/hugo-loveit\/","datePublished": "2020-10-27T23:36:15+08:00","dateModified": "2020-10-27T23:36:15+08:00","publisher": {
            "@type": "Organization",
            "name": "xls"},"author": {
                "@type": "Person",
                "name": "xls"
            },"description": ""
    }
    </script></head>
    <body header-desktop="" header-mobile=""><script type="text/javascript">(window.localStorage && localStorage.getItem('theme') ? localStorage.getItem('theme') === 'dark' : ('' === 'auto' ? window.matchMedia('(prefers-color-scheme: dark)').matches : '' === 'dark')) && document.body.setAttribute('theme', 'dark');</script>

        <div id="mask"></div><div class="wrapper"><header class="desktop" id="header-desktop">
    <div class="header-wrapper">
        <div class="header-title">
            <a href="/" title="我的Hugo博客">我的Hugo博客</a>
        </div>
        <div class="menu">
            <div class="menu-inner"><a class="menu-item" href="/posts/"> 文章 </a><a class="menu-item" href="/tags/"> 标签 </a><a class="menu-item" href="/categories/"> 分类 </a><span class="menu-item delimiter"></span><span class="menu-item search" id="search-desktop">
                        <input type="text" placeholder="搜索文章标题或内容..." id="search-input-desktop">
                        <a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-desktop" title="搜索">
                            <i class="fas fa-search fa-fw"></i>
                        </a>
                        <a href="javascript:void(0);" class="search-button search-clear" id="search-clear-desktop" title="清空">
                            <i class="fas fa-times-circle fa-fw"></i>
                        </a>
                        <span class="search-button search-loading" id="search-loading-desktop">
                            <i class="fas fa-spinner fa-fw fa-spin"></i>
                        </span>
                    </span><a href="javascript:void(0);" class="menu-item theme-switch" title="切换主题">
                    <i class="fas fa-adjust fa-fw"></i>
                </a>
            </div>
        </div>
    </div>
</header><header class="mobile" id="header-mobile">
    <div class="header-container">
        <div class="header-wrapper">
            <div class="header-title">
                <a href="/" title="我的Hugo博客">我的Hugo博客</a>
            </div>
            <div class="menu-toggle" id="menu-toggle-mobile">
                <span></span><span></span><span></span>
            </div>
        </div>
        <div class="menu" id="menu-mobile"><div class="search-wrapper">
                    <div class="search mobile" id="search-mobile">
                        <input type="text" placeholder="搜索文章标题或内容..." id="search-input-mobile">
                        <a href="javascript:void(0);" class="search-button search-toggle" id="search-toggle-mobile" title="搜索">
                            <i class="fas fa-search fa-fw"></i>
                        </a>
                        <a href="javascript:void(0);" class="search-button search-clear" id="search-clear-mobile" title="清空">
                            <i class="fas fa-times-circle fa-fw"></i>
                        </a>
                        <span class="search-button search-loading" id="search-loading-mobile">
                            <i class="fas fa-spinner fa-fw fa-spin"></i>
                        </span>
                    </div>
                    <a href="javascript:void(0);" class="search-cancel" id="search-cancel-mobile">
                        取消
                    </a>
                </div><a class="menu-item" href="/posts/" title="">文章</a><a class="menu-item" href="/tags/" title="">标签</a><a class="menu-item" href="/categories/" title="">分类</a><a href="javascript:void(0);" class="menu-item theme-switch" title="切换主题">
                <i class="fas fa-adjust fa-fw"></i>
            </a></div>
    </div>
</header>
<div class="search-dropdown desktop">
    <div id="search-dropdown-desktop"></div>
</div>
<div class="search-dropdown mobile">
    <div id="search-dropdown-mobile"></div>
</div>
<main class="main">
                <div class="container"><div class="toc" id="toc-auto">
            <h2 class="toc-title">目录</h2>
            <div class="toc-content" id="toc-content-auto"></div>
        </div><article class="page single"><h1 class="single-title animated flipInX">Hugo LoveIt</h1><div class="post-meta">
            <div class="post-meta-line"><span class="post-author"><a href="/" title="Author" rel=" author" class="author"><i class="fas fa-user-circle fa-fw"></i>xls</a></span></div>
            <div class="post-meta-line"><i class="far fa-calendar-alt fa-fw"></i>&nbsp;<time datetime="2020-10-27">2020-10-27</time>&nbsp;<i class="fas fa-pencil-alt fa-fw"></i>&nbsp;约 258 字&nbsp;
                <i class="far fa-clock fa-fw"></i>&nbsp;预计阅读 2 分钟&nbsp;</div>
        </div><div class="details toc" id="toc-static"  kept="">
                <div class="details-summary toc-title">
                    <span>目录</span>
                    <span><i class="details-icon fas fa-angle-right"></i></span>
                </div>
                <div class="details-content toc-content" id="toc-content-static"><nav id="TableOfContents"></nav></div>
            </div><div class="content" id="content"><h1 id="下载hugo">下载hugo</h1>
<p><a href="https://github.com/gohugoio/hugo/releases">https://github.com/gohugoio/hugo/releases</a></p>
<p>下载对应的版本，我这里下载的是Windows-64bit.zip</p>
<h1 id="配置环境变量">配置环境变量</h1>
<p><img
        class="lazyload"
        src="/svg/loading.min.svg"
        data-src="../../img/Hugo/1.png"
        data-srcset="../../img/Hugo/1.png, ../../img/Hugo/1.png 1.5x, ../../img/Hugo/1.png 2x"
        data-sizes="auto"
        alt="../../img/Hugo/1.png"
        title="../../img/Hugo/1.png" /></p>
<p>系统变量的Path</p>
<p>复制hugo.exe的路径到上图所示</p>
<h1 id="创建站点">创建站点</h1>
<p>打开cmd进入到hugo.exe目录下执行<strong>hugo version</strong>可以查看版本</p>
<p>hugo new site sitename(sitename是自定义文件夹名称)</p>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">hugo new site sitename
</code></pre></div><h1 id="下载并设置主题">下载并设置主题</h1>
<p>在cmd下进入sitename目录下</p>
<p><strong>git clone</strong> <a href="https://gitee.com/xls7771/LoveIt.git">https://gitee.com/xls7771/LoveIt.git</a> <strong>themes</strong>/LoveIt(主题可以自行查找，这里我选的是LoveIt，加粗字体是必须写的，其他的可以自定义)</p>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">git clone https://gitee.com/xls7771/LoveIt.git themes/LoveIt
</code></pre></div><h1 id="在本地启动个人博客">在本地启动个人博客</h1>
<p>配置config.toml 其中的title可以设置页面的标题</p>
<div class="highlight"><pre class="chroma"><code class="language-toml" data-lang="toml"><span class="nx">baseURL</span> <span class="p">=</span> <span class="s2">&#34;http://example.org/&#34;</span>
<span class="c"># [en, zh-cn, fr, ...] determines default content language</span>
<span class="nx">defaultContentLanguage</span> <span class="p">=</span> <span class="s2">&#34;en&#34;</span>
<span class="c"># language code</span>
<span class="nx">languageCode</span> <span class="p">=</span> <span class="s2">&#34;en&#34;</span>
<span class="nx">title</span> <span class="p">=</span> <span class="s2">&#34;My New Hugo Site&#34;</span>

<span class="c"># Change the default theme to be use when building the site with Hugo</span>
<span class="nx">theme</span> <span class="p">=</span> <span class="s2">&#34;LoveIt&#34;</span>

<span class="p">[</span><span class="nx">params</span><span class="p">]</span>
  <span class="c"># LoveIt theme version</span>
  <span class="nx">version</span> <span class="p">=</span> <span class="s2">&#34;0.2.X&#34;</span>

<span class="p">[</span><span class="nx">menu</span><span class="p">]</span>
  <span class="p">[[</span><span class="nx">menu</span><span class="p">.</span><span class="nx">main</span><span class="p">]]</span>
    <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">&#34;posts&#34;</span>
    <span class="c"># you can add extra information before the name (HTML format is supported), such as icons</span>
    <span class="nx">pre</span> <span class="p">=</span> <span class="s2">&#34;&#34;</span>
    <span class="c"># you can add extra information after the name (HTML format is supported), such as icons</span>
    <span class="nx">post</span> <span class="p">=</span> <span class="s2">&#34;&#34;</span>
    <span class="nx">name</span> <span class="p">=</span> <span class="s2">&#34;Posts&#34;</span>
    <span class="nx">url</span> <span class="p">=</span> <span class="s2">&#34;/posts/&#34;</span>
    <span class="c"># title will be shown when you hover on this menu link</span>
    <span class="nx">title</span> <span class="p">=</span> <span class="s2">&#34;&#34;</span>
    <span class="nx">weight</span> <span class="p">=</span> <span class="mi">1</span>
  <span class="p">[[</span><span class="nx">menu</span><span class="p">.</span><span class="nx">main</span><span class="p">]]</span>
    <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">&#34;tags&#34;</span>
    <span class="nx">pre</span> <span class="p">=</span> <span class="s2">&#34;&#34;</span>
    <span class="nx">post</span> <span class="p">=</span> <span class="s2">&#34;&#34;</span>
    <span class="nx">name</span> <span class="p">=</span> <span class="s2">&#34;Tags&#34;</span>
    <span class="nx">url</span> <span class="p">=</span> <span class="s2">&#34;/tags/&#34;</span>
    <span class="nx">title</span> <span class="p">=</span> <span class="s2">&#34;&#34;</span>
    <span class="nx">weight</span> <span class="p">=</span> <span class="mi">2</span>
  <span class="p">[[</span><span class="nx">menu</span><span class="p">.</span><span class="nx">main</span><span class="p">]]</span>
    <span class="nx">identifier</span> <span class="p">=</span> <span class="s2">&#34;categories&#34;</span>
    <span class="nx">pre</span> <span class="p">=</span> <span class="s2">&#34;&#34;</span>
    <span class="nx">post</span> <span class="p">=</span> <span class="s2">&#34;&#34;</span>
    <span class="nx">name</span> <span class="p">=</span> <span class="s2">&#34;Categories&#34;</span>
    <span class="nx">url</span> <span class="p">=</span> <span class="s2">&#34;/categories/&#34;</span>
    <span class="nx">title</span> <span class="p">=</span> <span class="s2">&#34;&#34;</span>
    <span class="nx">weight</span> <span class="p">=</span> <span class="mi">3</span>

<span class="c"># Markup related configuration in Hugo</span>
<span class="p">[</span><span class="nx">markup</span><span class="p">]</span>
  <span class="c"># Syntax Highlighting (https://gohugo.io/content-management/syntax-highlighting)</span>
  <span class="p">[</span><span class="nx">markup</span><span class="p">.</span><span class="nx">highlight</span><span class="p">]</span>
    <span class="c"># false is a necessary configuration (https://github.com/dillonzq/LoveIt/issues/158)</span>
    <span class="nx">noClasses</span> <span class="p">=</span> <span class="kc">false</span>
</code></pre></div><p>创建第一篇文章</p>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">hugo new posts/first_post.md
</code></pre></div><p>在sitename目录下</p>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">hugo serve
</code></pre></div><p>转到<code>http://localhost:1313</code></p>
<p>由于主题<code>.Scratch</code>在Hugo中用于实现某些功能，因此强烈建议您<code>--disableFastRender</code>在<code>hugo server</code>命令中添加参数，以实时编辑正在编辑的页面。</p>
<p>详细可以去参考https://hugoloveit.com/</p>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">hugo serve --disableFastRender
</code></pre></div><h1 id="建立网站">建立网站</h1>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">hugo
</code></pre></div><p><code>public</code>将生成一个文件夹，其中包含您网站的所有静态内容和资产。现在可以将其部署在任何Web服务器上。</p>
<h1 id="部署到gitee">部署到gitee</h1>
<p>修改config.toml里面的baseURL = &ldquo;https://你的用户名.gitee.io&rdquo;</p>
<p>进入到public然后gitbash</p>
<div class="highlight"><pre class="chroma"><code class="language-bash" data-lang="bash">git init

git add

git commit -m <span class="s2">&#34;first commit&#34;</span>

git remote add origin https://gitee.com/xls7771/xls7771.git

git push -u origin master
</code></pre></div><h1 id="详细介绍">详细介绍</h1>
<p>请访问https://hugoloveit.com/</p>
</div><div class="post-footer" id="post-footer">
    <div class="post-info">
        <div class="post-info-line">
            <div class="post-info-mod">
                <span>更新于 2020-10-27</span>
            </div>
            <div class="post-info-license"></div>
        </div>
        <div class="post-info-line">
            <div class="post-info-md"></div>
            <div class="post-info-share">
                <span><a href="javascript:void(0);" title="分享到 Twitter" data-sharer="twitter" data-url="https://xls7771.gitee.io/posts/hugo-loveit/" data-title="Hugo LoveIt"><i class="fab fa-twitter fa-fw"></i></a><a href="javascript:void(0);" title="分享到 Facebook" data-sharer="facebook" data-url="https://xls7771.gitee.io/posts/hugo-loveit/"><i class="fab fa-facebook-square fa-fw"></i></a><a href="javascript:void(0);" title="分享到 Buffer" data-sharer="buffer" data-url="https://xls7771.gitee.io/posts/hugo-loveit/" data-title="Hugo LoveIt"><i class="fab fa-buffer fa-fw"></i></a><a href="javascript:void(0);" title="分享到 百度" data-sharer="baidu" data-url="https://xls7771.gitee.io/posts/hugo-loveit/" data-title="Hugo LoveIt"><i data-svg-src="/lib/simple-icons/icons/baidu.min.svg"></i></a></span>
            </div>
        </div>
    </div>

    <div class="post-info-more">
        <section class="post-tags"></section>
        <section>
            <span><a href="javascript:void(0);" onclick="window.history.back();">返回</a></span>&nbsp;|&nbsp;<span><a href="/">主页</a></span>
        </section>
    </div>

    <div class="post-nav"><a href="/posts/linux/" class="prev" rel="prev" title="Linux"><i class="fas fa-angle-left fa-fw"></i>Linux</a>
            <a href="/posts/redis/" class="next" rel="next" title="Redis">Redis<i class="fas fa-angle-right fa-fw"></i></a></div>
</div>
</article></div>
            </main><footer class="footer">
        <div class="footer-container"><div class="footer-line">由 <a href="https://gohugo.io/" target="_blank" rel="noopener noreffer" title="Hugo 0.74.2">Hugo</a> 强力驱动 | 主题 - <a href="https://github.com/dillonzq/LoveIt" target="_blank" rel="noopener noreffer" title="LoveIt 0.2.10"><i class="far fa-kiss-wink-heart fa-fw"></i> LoveIt</a>
                </div><div class="footer-line"><i class="far fa-copyright fa-fw"></i><span itemprop="copyrightYear">2020</span><span class="author" itemprop="copyrightHolder">&nbsp;<a href="/" target="_blank">xls</a></span></div>
        </div>
    </footer></div>

        <div id="fixed-buttons"><a href="#" id="back-to-top" class="fixed-button" title="回到顶部">
                <i class="fas fa-arrow-up fa-fw"></i>
            </a><a href="#" id="view-comments" class="fixed-button" title="查看评论">
                <i class="fas fa-comment fa-fw"></i>
            </a>
        </div><script type="text/javascript" src="/lib/smooth-scroll/smooth-scroll.min.js"></script><script type="text/javascript" src="/lib/autocomplete/autocomplete.min.js"></script><script type="text/javascript" src="/lib/lunr/lunr.min.js"></script><script type="text/javascript" src="/lib/lunr/lunr.stemmer.support.min.js"></script><script type="text/javascript" src="/lib/lunr/lunr.zh.min.js"></script><script type="text/javascript" src="/lib/lazysizes/lazysizes.min.js"></script><script type="text/javascript" src="/lib/clipboard/clipboard.min.js"></script><script type="text/javascript" src="/lib/sharer/sharer.min.js"></script><script type="text/javascript">window.config={"code":{"copyTitle":"复制到剪贴板","maxShownLines":10},"comment":{},"search":{"highlightTag":"em","lunrLanguageCode":"zh","lunrSegmentitURL":"/lib/lunr/lunr.segmentit.js","maxResultLength":10,"noResultsFound":"没有找到结果","snippetLength":30}};</script><script type="text/javascript" src="/js/theme.min.js"></script></body>
</html>
